Why I missed this easy solution beats me, however, as my team mate Freddy points out in his (e-mail) answer to my comment on his blog about HTTP Filtered Value Sets it is even easier to publish XML data – or any other data – on Tomcat than by creating a web application as described in my last post.
* Update *: See Publishing XML and Other Data With the WAS Liberty Profile for how to do this with the WAS Liberty Profile.
Solution
Basically what you have to do is to publish it in the folder $CATALINA_HOME/webapps/ROOT/. In the context of a Jazz Team Server that is the folder /server/tomcat/webapps/ROOT/. If you have a file test.xml you want to publish on your Tomcat server you can copy it directly into that folder or into a sub folder structure.
Example
To publish the given file makers.xml from the last post as https://localhost:9443/PEWEnactmentData/makers.xml, assuming a standard Jazz Tomcat deployment.
- Create a folder PEWEnactmentData in the folder <InstallDir>/server/tomcat/webapps/ROOT/
- Copy the file makers.xml into the newly created folder
The File is now accessible as https://localhost:9443/PEWEnactmentData/makers.xml as intended. Replace localhost with your fully qualified hostname in your deployment.
Note: Please make sure that your Folder Name does not conflict with the context root of any web application you have deployed on Tomcat.
Summary
Given this approach it is as easy to use Tomcat to maintain your data for HTTP Filtered value providers as using Apache.
This is also a good example how hard it can be to find information in the Internet. I tried to search for publishing XML on Tomcat with what I learned from Freddy, and I did not find an answer to the question really. All the discussions are around deploying applications.
Hi Ralph,
I have deployed the XML file as described above and i can access it in browser with the URL
http://localhost:8888/example_data/makers.xml
But when i use this same URL in value set i give me error as “Problems accessing ‘http://localhost:8888/example_data/makers.xml’: Connection to http://localhost:8888 refused”
Any advice on this please ?
Thanks
Akshay
I would try http:/localhost:8888/example_data/makers.xml
I would also consider to have a domain name for the server and not localhost.
Hi Ralph,
Thanks for the reply i tried with http:/localhost:8888/example_data/makers.xml as suggested but it gave below error-
Problems accessing ‘http:/localhost:8888/example_data/makers.xml’: URI does not specify a valid host name: http:/localhost:8888/example_data/makers.xml
Yes, i tried to map localhost to domain name but for that i need to amend the windows host file for which i do not have access. 😦
I can’t tell you what the problem is. If you can access the file using a browser. Check the security settings. You sure the protocol is http and not HTTPS?